<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script src="js/lib/angular.min.js"></script>	
		<link rel="stylesheet" href="css/lib/bootstrap.min.css" />
		<link rel="stylesheet" href="js/themes/default/easyui.css" />
		<script src="js/lib/jquery-1.11.0.js"></script>
		<script src="js/lib/bootstrap.min.js"></script>	
		<script src="js/base.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<style>
		body{
			font-size:12px;
		}
		
		table td:nth-child(even) {
			
		}
		input{
			width:280px;
		}
		span{
			width:20px;color:red;display:inline-block;text-align:center;
		}
		#sho{
			width:300px;
			height:50px;
			background:#d9534f;
			opacity:0.8;
			border-radius:8px;
			color:#fff;
			text-align: center;
			font-size:30px;
			position: absolute;
			top:0px;
			left:550px;
			display:none;
		}
		#kai{
			width:50px;
			height:30px;			
			border:0;
			color:#fff;
			float:left;
			background:rgb(0, 122, 255);

			}
		#guan{
			width:50px;
			height:30px;
			border:0;
			color:#fff;
			background:#666;
			float:right;
		}
		
	</style>
	<body ng-app="myApp" ng-controller="customersCtrl">
		<div class="">
			<div id="sho"></div>
		<div style="padding:15px 5px 0px 5px;border:.5px solid #ccc;margin-bottom:15px;width:100%;box-shadow:3px 5px 15px">
			<table class="table table-hover">				
					<tr>
						<th colspan="7" style="font-size:26px;color:#337ab7">当前所有通道信息：
							
		                    <div id="showtime" style="width:200px;height:34px;line-height:34px;float:right;text-align:center;">
		                    	
		                    </div>
						</th>
					</tr>
					<tr style="font-size:15px;background:rgb(0, 122, 255);color:#fff">
						<td style="width:55px;" class="text-center">序号</td>
						<!--<td class="text-center">通道</td>-->
						<td class="text-center">通道编号</td>
						<td class="text-center">通道名称</td>
						<td class="text-center">通道限额</td>
						<td class="text-center">通道状态</td>
						<td class="text-center">APP余额/储蓄卡</td>
						<td class="text-center">加急费</td>
						<td class="text-center">提现费</td>
					</tr>
					<tr ng-repeat="item in items" ng-show="item.status==1">
						<td class="text-center">#{{$index+1}}</td>
						<!--<td class="text-center">{{item.channelTag | modify0:item.channelTag}}</td>-->
						<td class="text-center">{{item.id}}</td>
						<td class="text-left" style="width:20%"><img style="width:30px;height:30px;margin:0 20px 0 30px" src="{{item.log}}" alt="log">{{item.name}}-{{item.channelParams}}</td>
						<td class="text-center">限额：{{item.singleMinLimit+"元"}}~{{item.singleMaxLimit+"元"}} 单日额度：￥{{item.everyDayMaxLimit}}</td>
							<td class="text-center">
							 <!-- {{item.status}}  -->
							<div style="color:#fff;background:#00CC00;width:65px;height:24px;text-align:center;line-height:24px;border-radius:6px;display:inline-block;margin:0px auto" ng-if="item.status==1">运行中</div>
							<div style="color:#fff;background:#FF6666;width:65px;height:24px;text-align:center;line-height:24px;border-radius:6px;display:inline-block;margin:0px auto"  ng-if="item.status==2">维护中</div>
							</td>
						<td class="text-center">{{item.remarks}}</td>
						<td class="text-center">{{item.extraFee-item.withdrawFee}}元</td>
						<td class="text-center">{{item.withdrawFee}}元</td>
					</tr>
					<tr>
						<td colspan="7" ng-show="items.length==0" style="text-align:center;">
							暂无通道信息
						</td>
					</tr>
					<tr>
						<td colspan="7" id="show02" class="text-left">			
						温馨提示：<span style="display:inline">通道状态显示通道当前是否开启;</span>
						</td>
					</tr>
								
			</table>		
		</div>
		
		</div>
	</body>
	<script>		
		$(function(){			
				/*获取所有贴牌名称*/
		        $.ajax({
		            type:"GET",
		            url:window.baseUrl+"user/brand/query/all",
		            async:true,
		            dataType:"json",
		            data:{
		            	//brand_id:1
		            },
		            success:function(data){               
		                console.log(data.result)
		                var html = "<option selected='selected' value=''>请选择贴牌</option>";
		                var vendorJson = eval(data.result);
		                for(var i=0; i<vendorJson.length; i++){
		                html += "<option value= '"+vendorJson[i].id+"'>"+vendorJson[i].name+"</option>";
		                }
		                $("#msg1").html('').append(html);		               
		            },
		            error:function(data){
		                alert('失败')
		            }
		        });
		        /*选中贴牌id*/
		        $('#msg1').change(function(){
		      			console.log($('#msg1').val());
		      			var brandid = $('#msg1').val();
		      			sessionStorage.setItem(3,brandid);
		      			$('#showtime').html($('#op').text())

		      			/*$('#showtime').find('option:selected').text();*/
		        });
				
		})
	</script>
	<script>
		var app = angular.module('myApp', []);
			 /*自定义过滤器   1*/
		app.filter("modify",function(){
			return function(input,param){
				if(param == 0){
					return param = "充值"
				}
				if(param == 1){
					return param = "支付"
				}
				if(param == 2){
					return param = "提现"
				}
				if(param == 3){
					return param = "退单"
				}
				if(param == 4){
					return param = "话费充值"
				}
				input = param
				return input
			}
		})	
		   /*过滤器*/
		app.filter("modify1",function(){
			return function(input,param){
				if(param == 0){
					return param = "开发中..."
				}
				if(param == 1){
					return param = "✅"
				}
				if(param == 2){
					return param = "⭕"
				}				
				input = param
				return input
			}
		})	  
	        app.controller('customersCtrl', function($scope, $http ){
			/*查询所有渠道标识*/
				/*var userid = sessionStorage.getItem(4)*/
				var userid= sessionStorage.getItem(key=4);
				var data ={user_id:userid}
				$http({
					method: 'POST',
					params:data,
					url: window.baseUrl+'user/channel/query/all/brandid'
				}).then(function successCallback(data){
						console.log("请求所有数据成功...")
						console.log(data.data.result)
						$scope.items = data.data.result
				}, function errorCallback(data){
						console.log("请求数据失败...")
				     	alert("网络错误，请重试")
				});
				

			})

	</script>
</html>




